function Sender()
{
	this.signal = new Signal()
	this._xhr = new XMLHttpRequest();
}

	Sender.LOAD_COMPLETE = "loadComplete";
	
	Sender.prototype.signal = null;
	Sender.prototype._xhr	= null;
	Sender.prototype._data	= null;
	
	Sender.prototype.sendAndLoad = function( p_url, p_data, p_method, p_async )
	{
		var _this = this;
		p_async = p_async || false;
		p_data = p_data || null;
		p_method = ( p_method == "POST" ) ? "POST" : "GET";
		
		this._xhr.onreadystatechange = function()
		{
			_this.completeHandler();
		};
		
		
		
		this._xhr.open( p_method, p_url, p_async );
		
		if( p_method == "POST" )
			 this._xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); 
		
		this._xhr.send(p_data);
	};
	
	
	Sender.prototype.completeHandler = function()
	{
		if( this._xhr.readyState == 4 )
		{
			this._data = this._xhr.responseText;
			this.signal.dispatchEvent( Sender.LOAD_COMPLETE );
		}
	};
	
	Sender.prototype.getData = function()
	{
		return this._data;
	};
